package com.smartcommunity.entity.village;

import com.smartcommunity.bean.enumeration.HouseTypeEnum;
import com.smartcommunity.entity.people.RealPeopleHouse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @ClassName: House
 * @Description: 房屋信息实体类
 * @author: minsheng
 * @Date: 2019/1/3 11:07
 * @Company:
 * @version V1.5.0
 */
@Data
@ApiModel
public class House implements Serializable {
    private static final long serialVersionUID = -1L;

    @ApiModelProperty(value="主键ID,房屋ID",name="id")
    private Integer id;

    @ApiModelProperty(value="小区编码,多小区以逗号分隔",name="villageCode",example = "123456")
    private String villageCode;

    @ApiModelProperty(value="小区名称",name="villageName",example = "小区名称")
    private String villageName;

    @NotBlank(message = "楼栋编号不能为空！")
    @ApiModelProperty(value="楼栋编号",name="buildingNo",example = "28")
    private String buildingNo;

    @NotBlank(message = "单元号不能为空！")
    @ApiModelProperty(value="单元号",name="unitNo",example = "28")
    private String unitNo;

    @NotBlank(message = "房间号不能为空！")
    @ApiModelProperty(value="房屋编号，单元编号示例：2单元101，编码为：2-101",name="houseNo",example = "101")
    private String houseNo;

    @NotBlank(message = "房屋名称不能为空！")
    @ApiModelProperty(value="房屋名称",name="houseName",example = "101")
    private String houseName;

    @ApiModelProperty(value="楼层",name="floor",example = "10")
    private String floor;

    @ApiModelProperty(value="房屋类型 0: 其他,1:自住房,2:出租房，3:闲置房，4.民宿，" +
            " 5.寄宿，6.借宿，7.单位宿舍，8.临时性宿舍，9.农民工公寓",name="type")
    private Integer type;

    @ApiModelProperty(value="类型描述",name="typeDesc")
    private String typeDesc;

    @ApiModelProperty(value="记录新增或更新时的时间",name="rowTime",hidden = true)
    private Date rowTime;

    @ApiModelProperty(value="录入库时间",name="mrowTime",hidden = true)
    private Date mrowTime;

    @ApiModelProperty(value="房屋里的人员标签(包括是否有烟感的标签)",hidden = true)
    private String label;

    @ApiModelProperty(value="地址",name="address")
    private String address;

    @ApiModelProperty(value="关联的证件号码",name="credentialNo")
    private String credentialNo;

    @ApiModelProperty(value="是否删除",hidden = true)
    private Integer status;

    @ApiModelProperty(value="当前页数",name="pageNumber",example = "1")
    private Integer pageNumber = 1;

    @ApiModelProperty(value="每页显示条数",name="pageSize",example = "10")
    private Integer pageSize = 10;

    private List<RealPeopleHouse> realPeoples;
    
    @ApiModelProperty(value="所属辖区")
    private String orgName;

    public void setTypeDesc(String typeDesc){
        if(this.type==null){
            this.typeDesc=null;
        }else {
        	this.typeDesc = HouseTypeEnum.getNamebyValue(this.type);
        }
    }

}
